package com.corpgovernment.organization.enumm;

import java.util.EnumSet;
import java.util.HashMap;
import java.util.Map;

public enum StaffStatusEnum {

    REFUSED(0,"拒绝"),
    normal(1,"正常"),
    CHECK(2,"待审核"),
    DIMISSION(3,"离职");


    /**
     * 证件名字
     */
    private String desc;

    /**
     * 证件类型
     */
    private Integer code;


    private StaffStatusEnum(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    private static final Map<Integer, StaffStatusEnum> lookup = new HashMap<>();

    static {
        for (StaffStatusEnum s : EnumSet.allOf(StaffStatusEnum.class)) {
            lookup.put(s.getCode(), s);
        }
    }

    public String getDesc() {
        return desc;
    }

    public Integer getCode() {
        return code;
    }

    public static StaffStatusEnum get(Integer code) {
        return lookup.get(code);
    }
    public static boolean exists(Integer code) {
        return lookup.containsKey(code);
    }
}
